package com.xiaomi.config;


import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RocketMQConfig {

    @Bean
    public DefaultMQPushConsumer defaultMQPushConsumer() throws Exception {
        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("battery_consumer");
        consumer.setNamesrvAddr("localhost:9876");
        consumer.subscribe("BATTERY_WARN_TOPIC", "*");
        return consumer;
    }

}